#ifndef POLLER_PROTOCOLL
#define POLLER_PROTOCOLL

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#define MESSAGE_SIZE 1024

#define QUIT_CONNECTION 0
#define MENU 1
#define VOTE_BEGIN 2
#define POLL_RESULTS_BEGIN 3
#define CREDENTIALS_REQUEST 4
#define CREDENTIALS_RESPONSE 5
#define VOTE_SUBJECT 6
#define ERROR_VOTE_AGAIN 7
#define VOTE 8
#define VOTE_REGISTERED 9
#define POLL_RESULTS 10
#define ERROR_NOT_VOTED 11

typedef enum boolean { false = 0, true } bool;

bool Send ( int header, const char *payload, int socket );
bool Wait ( int header, char *payload, int socket );
bool WaitResponse ( int *header, char *payload, int socket );

#endif





